#include <iostream>
#include <vector>
#include <functional>
using func = std::function<void()>;

class Task
{
public:
    Task()
    {
        TaskInit();
    }

    static void task1() { std::cout << "---running task1---" << std::endl; }
    static void task2() { std::cout << "---running task2---" << std::endl; }
    static void task3() { std::cout << "---running task3---" << std::endl; }
    static void task4() { std::cout << "---running task4---" << std::endl; }
    static void task5() { std::cout << "---running task5---" << std::endl; }

    void TaskInit()
    {
        tasks.push_back(task1);
        tasks.push_back(task2);
        tasks.push_back(task3);
        tasks.push_back(task4);
        tasks.push_back(task5);
        std::cout << "---TaskInit Done!!---" << std::endl;
    }

    void run(int pid ,int command)
    {   
        std::cout << "child: " << pid;
        tasks[command]();
    }

private:
    std::vector<func> tasks;
};